﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Configuration;

namespace CDKeyTool
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void btnEncode_Click(object sender, EventArgs e)
        {
            string strDBKey = dateTimePicker1.Value.ToString("yyyy-MM-dd");
            txtCDKey.Text = EIIS.Common.DEncrypt.DESEncrypt.Encrypt(strDBKey, "px!=630");

            strDBKey = ConfigurationManager.AppSettings["DBKey"];
            strDBKey = EIIS.Common.DEncrypt.DESEncrypt.Decrypt(strDBKey, "px!=630");
            DateTime dbKey = DateTime.Parse(strDBKey);
            DateTime now = DateTime.Now;
            TimeSpan ts = dbKey - now;
        }
    }
}
